package com.rocketmq.consumer;

import org.apache.rocketmq.common.message.MessageExt;
import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
import org.apache.rocketmq.spring.core.RocketMQListener;
import org.springframework.stereotype.Component;

/**
 * 同步消息消费测试
 * @author ytj
 * @date 2024/10/10 14:45
 */
@Component
@RocketMQMessageListener(consumerGroup = "boot-product",topic = "syn_test")
public class SynMessageTest implements RocketMQListener<MessageExt> {


    @Override
    public void onMessage(MessageExt messageExt) {
        System.out.println("接收到同步消息为:"+new String(messageExt.getBody()));
    }
}
